package com.hyk.commonLib.common.utils.eventHandler;

import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

import com.hyk.commonLib.common.activity.BaseActivity;
import com.hyk.commonLib.common.utils.ViewUtils;
import com.hyk.commonLib.common.utils.viewModel.BaseObservableModel;

import org.jetbrains.annotations.NotNull;

public class ViewHolderEventHandler<VIEW_HOLDER extends RecyclerView.ViewHolder, VIEW extends View, MODEL extends BaseObservableModel> extends BaseEventHandler<VIEW, MODEL> {
    private VIEW_HOLDER viewHolder;

    public ViewHolderEventHandler(@NotNull VIEW_HOLDER viewHolder, @NotNull VIEW view, MODEL model) {
        super(view, model);
        this.viewHolder = viewHolder;
    }

    public VIEW_HOLDER getViewHolder() {
        return viewHolder;
    }

    @Override
    public BaseActivity<?> getActivity() {
        return (BaseActivity<?>) ViewUtils.getActivity(getContainer());
    }
}
